import java.util.Scanner;

public class test8 {
    //在同一个类中定义多个方法：要求不仅可以求2个整数的最大值，还可以求3个小数的最大值？
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入两个整数:");
            int x1 = sc.nextInt();
            int x2 = sc.nextInt();
            int max1 = getMax(x1,x2);
            System.out.println("两个整数的最大值为:"+max1);

            System.out.println("请输入三个小数:");
            double f1 = sc.nextDouble();
            double f2 = sc.nextDouble();
            double f3 = sc.nextDouble();
            double max2 = getMax(f1,f2,f3);
            System.out.println("三个小数的最大值为:"+max2);
        }
        public static int getMax(int a,int b){
            if(a>=b){
                return a;
            }else {
                return b;
            }
        }
        public static double getMax(double a,double b,double c){
            if(a>=b&&a>=c){
                return a;
            } else if (b>=a&&b>=c) {
                return b;
            }else {
                return c;
            }
        }
}
